package com.lantosec.hmrp.modules.eval.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.eval.vo.EvalTypeVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.util.List;

/**
 * <p>
 * 考评项目分类定义 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EvalType extends BaseEntity<EvalTypeVO> {

    private static final long serialVersionUID = 1L;
    public EvalType(EvalTypeVO vo){
        this.evalTypeId = vo.getEvalTypeId();
        this.evalTypeName = vo.getEvalTypeName();
        this.evalTypeOrder = vo.getEvalTypeOrder();
        this.deptId = vo.getDeptId();
        this.managerId = vo.getManagerId();
        this.managerName = vo.getManagerName();
        this.parentId = vo.getParentId();
        this.leaf = vo.getLeaf();
    }

    @Override
    public EvalTypeVO convertToVO(){
        return new EvalTypeVO(this);
    }


    /**
     * 考评项目分类ID
     */
    @TableId(value = "eval_type_id", type = IdType.ASSIGN_UUID)
    private String evalTypeId;

    /**
     * 考评项目分类名称
     */
    private String evalTypeName;

    /**
     * 排序
     */
    private Integer evalTypeOrder;

    /**
     * 部门ID
     */
    private String deptId;

    /**
     * 管理人员ID
     */
    private String managerId;

    /**
     * 管理人
     */
    private String managerName;

    /**
     * 上级ID
     */
    private String parentId;

    /**
     * 是否末级
     */
    private Integer leaf;



    public enum ColName {
        eval_type_id, eval_type_name, eval_type_order, dept_id, manager_id, manager_name, parent_id, leaf,
    }
}
